package com.luweijie.sh.mapper;

import com.luweijie.sh.entity.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 菜单表 Mapper 接口
 * </p>
 *
 * @author luweijie
 * @since 2020-06-11
 */
@Mapper
public interface MenuMapper extends BaseMapper<Menu> {

   @Select("select m.icon,m.href,m.`name` " +
           "from roles r,role_menu_relation rm,menu m" +
           " where r.type='#{roles} and r.id=rm.role_id and rm.menu_id=m.id")
     List<Menu> queryMenu(@Param("roles") String roles);
}
